<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends MY_Controller{

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	
	public function __construct()
    {
        parent::__construct();
		$this->load->database();
		$this->load->library('session');
	}
	public function index()		
	{	
		$tzgg = $this->db->query("select id,title,intotime from oa_articlemain where (memberids like '%,".$this->session->userdata("userid").",%' or userid =".$this->session->userdata("userid").") and artitype=1 order by id desc limit 0,5 ");
		$wdbq = $this->db->query("select id,title,intotime from oa_articlemain where (memberids like '%,".$this->session->userdata("userid").",%' or userid =".$this->session->userdata("userid").") and artitype=4 order by id desc limit 0,5 ");
		$gzjh = $this->db->query("select id,title,intotime from oa_articlemain where (memberids like '%,".$this->session->userdata("userid").",%' or userid =".$this->session->userdata("userid").") and artitype=2 order by id desc limit 0,5 ");
		$zndx = $this->db->query("select id,title,intotime from oa_articlemain where (memberids like '%,".$this->session->userdata("userid").",%' or userid =".$this->session->userdata("userid").") and artitype=3 order by id desc limit 0,5 ");
		$data['tzgg'] = $tzgg->result_array();
		$data['wdbq'] = $wdbq->result_array();
		$data['gzjh'] = $gzjh->result_array();
		$data['zndx'] = $zndx->result_array();
		
		//echo "<pre>";var_dump($data['tzgg']);exit;

		$data['menu'] = $this->getMenu();
		$this->load->view('index', $data);
	}
	/*
	header("Content-Type:text/html;charset=utf-8");
		echo "<script>alert('12');window.location.href='/index.php/Login/index';</script>";
	*/
	
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */